<?php
/**
 * Created by PhpStorm.
 * User: sunquan
 * Date: 2019/3/5
 * Time: 15:59
 */
namespace App\Http\Controllers\Space;


use App\Http\Controllers\BaseApiController;
use App\Services\Space\SpaceService;
use Illuminate\Http\Request;
use Validator;
/*
 *   航运空间以及航运测评
 */
class SpaceController extends BaseApiController{
    /*
     *  航运空间轮播图
     */
    public function image(){
        $image = SpaceService::image();
        return $image;
    }

    /*
     *  航运空间评论
     */
    public function comment(){
        $res = SpaceService::comment();
        return $res;
    }

    /*
     *  发布动态
     */
    public function addfb(Request $request){
        $arr = $request->post();
        $res = SpaceService::addfb($arr);
        return $res;
    }


    /*
     *  航运测评题目展示
     */
    public function testlist(){
        $res = SpaceService::testlist();
        return $res;
    }

    /*
     *  查询出该题目的题
     */
    public function testlists(Request $request){
        // 进行验证 用户id
        $validator = Validator::make($request->all(), [
            'testid' => 'required',
        ]);
        $res = SpaceService::testlists($request->testid);
        return $res;
    }

    /*
     *  测试题搜索
     */
    public function testsou(Request $request){
        $validator = Validator::make($request->all(), [
            'sou' => 'required',
        ]);
        $res = SpaceService::testsou($request->sou);
        return $res;
    }
}